package jp.go.aist.six.test.util.castor.persist;

import jp.go.aist.six.util.castor.CastorPersistable;


public class ProductGroup
extends CastorPersistable<Integer>
{

    private int       _id;
    private String    _name;


    public ProductGroup()
    {
    }


    public ProductGroup(
                    final int id,
                    final String name
                    )
    {
        setId( id );
        setName( name );
    }


    public int getId()
    {
        return _id;
    }


    public void setId( int id )
    {
        _id = id;
    }


    public String getName()
    {
        return _name;
    }


    public void setName( String name )
    {
        _name = name;
    }


    public String toString()
    {
        return "ProductGroup-" + System.identityHashCode( this )
                        + "<id: " + _id + " name: " + _name + ">";
    }


    // AbstractPersistable //

    @Override
    public void setPersistentID(
                    final Integer id
                    )
    {
        if (id != null) {
            setId( id.intValue() );
        }
    }


    @Override
    public Integer getPersistentID()
    {
        return (new Integer( getId() ));
    }

}

